//
//  BaseController.m
//  NewNest
//
//  Created by hesiyao on 16/1/14.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "BaseController.h"
#import <UIColor+Wonderful.h>
#import "AccountManager.h"
@interface BaseController ()

@end

@implementation BaseController

- (void)dealloc
{
    // 监听要在dealloc方法里面移除掉
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationController.navigationBar.tintColor = [UIColor peachRed];
    self.view.frame = [UIScreen mainScreen].bounds;
//    // 背景颜色为白色
    self.view.backgroundColor = [UIColor whiteColor];

    
    
    if ([AccountManager sharedInstance].isNight) {
        [self setNightDayModel];
    }else {
        [self setLightDayModel];
    }
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setLightDayModel) name:@"day" object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setNightDayModel) name:@"night" object:nil];
    
}

- (void)setLightDayModel {
    NSLog(@"设置白天模式成功");
}

- (void)setNightDayModel {
    NSLog(@"设置夜晚模式成功");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
